package com.suptracking.entity;

import java.io.Serializable;
import java.util.List;







import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;


@Entity
public class Car implements Serializable {
	
	@Id	@GeneratedValue(strategy=GenerationType.AUTO)
	private long id;
	@ManyToOne
	@JoinColumn
	private User User;
	
	private String name;
	private Position currentCarPosition;
	private String brand;
	private String firstEntryYear;
	
	 @OneToMany(fetch = FetchType.EAGER ,mappedBy="Car")
		 private List<Position> Position ;
	 
	 @OneToMany(fetch = FetchType.EAGER ,mappedBy="Car")
	 private List<Zone> Zone ;
		 
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getBrand() {
		return brand;
	}
	public void setBrand(String brand) {
		this.brand = brand;
	}
	
	

	
	
	public String getFirstEntryYear() {
		return firstEntryYear;
	}
	public void setFirstEntryYear(String firstEntryYear) {
		this.firstEntryYear = firstEntryYear;
	}
	public List<Position> getHistoriquePosition() {
		return Position;
	}
	public void setHistoriquePosition(List<Position> historiquePosition) {
		this.Position = historiquePosition;
	}


	public Position getCurrentCarPosition() {
		return currentCarPosition;
	}
	public void setCurrentCarPosition(Position currentCarPosition) {
		this.currentCarPosition = currentCarPosition;
	}


	public List<Position> getPosition() {
		return Position;
	}
	public void setPosition(List<Position> position) {
		Position = position;
	}
	public User getUser() {
		return User;
	}
	public void setUser(User user) {
		User = user;
	}


	public List<Zone> getZone() {
		return Zone;
	}
	public void setZone(List<Zone> zone) {
		Zone = zone;
	}


	 
	
	
}